home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 095 / tbbs105.arc / BBS.PAS next >
Pascal/Delphi Source File  |  1985-10-24  |  7KB  |  203 lines

  1. {$R-}
  2. {$C-}
  3. {$U-}
  4. program TurboBBS;
  5.  
  6. (*******************************************************************)
  7. (*                                                                 *)
  8. (*  Turbo Bulletin Board System Source Code Master  Version 1.05   *)
  9. (*                                                                 *)
  10. (*  (c) 1985 by Robert H. Maxwell                                  *)
  11. (*              201 - 2275 West 7th Avenue,                        *)
  12. (*              Vancouver, British Columbia, CANADA                *)
  13. (*              V6K 1Y3                                            *)
  14. (*                                                                 *)
  15. (*  Original System running 300/1200 baud, 24hrs: (604) 738-7811   *)
  16. (*  Written for a Kaypro 2-84 using Rixon 212A Intelligent modem   *)
  17. (*  Modified for IBM PC use with Hayes-compatible modems           *)
  18. (*
  19. (*  If you like this program, it would most appreciated if you     *)
  20. (*  sent $30 to the above address. If you choose to operate a BBS  *)
  21. (*  with it, please forward the details so you can be kept up to   *)
  22. (*  date with changes to the program.                              *)
  23. (*                                                                 *)
  24. (*  The author has released this code to the public domain, but    *)
  25. (*  reserves all rights to the program. No other party is to make  *)
  26. (*  any charge for this program other than for media and special   *)
  27. (*  preparation charges, such as customization,                    *)
  28. (*                                                                 *)
  29. (*  While every reasonable effort has been made to ensure the      *)
  30. (*  reliability of this program, the author assumes no liability   *)
  31. (*  for any damages that may arise from its use.                   *)
  32. (*                                                                 *)
  33. (*  Files required for compile: BBS.PAS     (this file)            *)
  34. (*                              BBS2.INC    (support routines)     *)
  35. (*                              MACHDEP.IBM (machine dependent)    *)
  36. (*                              IO.INC      (Input/Output drivers) *)
  37. (*                              MAILSYS.INC (Sections named here)  *)
  38. (*                              FILESYS.INC (XMODEM code here)     *)
  39. (*                                                                 *)
  40. (*  Information files required: BBSINFO.LBR (members listed below) *)
  41. (*                                                                 *)
  42. (*  The following files are created by the program:                *)
  43. (*                              MESSAGES.BBS (Message table)       *)
  44. (*                              FILES.BBS    (Files table)         *)
  45. (*  Clear these periodically: / COMMENTS.BBS (Comments for Sysop)  *)
  46. (*  They can grow quickly...  \ LOG.BBS      (call log file)       *)
  47. (*                              IDS.BBS      (user list)           *)
  48. (*                                                                 *)
  49. (*  .TXT files are WordStar editable; .BBS files are program data  *)
  50. (*  maintained by the program.                                     *)
  51. (*  User SYSOP is automatically given sysop access on system.      *)
  52. (*                                                                 *)
  53. (*******************************************************************)
  54.  
  55. const
  56.   version   = '1.05';
  57.  
  58.   clockin = true;  { Set to false if no clock available. }
  59.   sectsin = true;  { Use to turn section feature on/off. }
  60.   openBBS = true;  { Selects a private or public system. }
  61.  
  62.   messdrive = 'C:';  { Drive on which messages go }
  63.   filedrive = 'C:';  { Drive for storing files }
  64.  
  65.   applying = 'BBSINFO/APPLYING.TXT';
  66.   welcome  = 'BBSINFO/WELCOME.TXT';   {Info files:    }
  67.   otherBBS = 'BBSINFO/BBSLIST.TXT';   {text before "/"}
  68.   helpfile = 'BBSINFO/BBSHELP.TXT';   {is name of the }
  69.   sysinfo  = 'BBSINFO/SYSINFO.TXT';   {.LBR library   }
  70.   meetings = 'BBSINFO/MEETING.TXT';   {file with the  }
  71.   bulletin = 'BBSINFO/BULLETIN.TXT';  {member filename}
  72.   filehelp = 'BBSINFO/FILEHLP.TXT';   {after the "/". }
  73.   mainmenu = 'BBSINFO/MAINMENU.TXT';
  74.   readmenu = 'BBSINFO/READMENU.TXT';
  75.   filemenu = 'BBSINFO/FILEMENU.TXT';
  76.   editmenu = 'BBSINFO/EDITMENU.TXT';
  77.  
  78.   sysop   = 5;  { Access levels }
  79.   reg     = 2;
  80.   newuser = 1;
  81.   twit    = 0;
  82.  
  83.   noecho    = false;
  84.   echo      = true;
  85.   null      = #0;
  86.   abort     = #3;
  87.   bell      = #7;
  88.   bksp      = #8;
  89.   tab       = #9;
  90.   lnfd      = #10;
  91.   cr        = #13;
  92.   pause     = #19;
  93.   esc       = #27;
  94.   space     = ' ';
  95.  
  96. type
  97.   name      = string[14];
  98.   longname  = string[25];
  99.   filbuffer = array[0..127] of byte;
  100.   rate      = (slow,fast);
  101.   line      = string[80];
  102.   person    = string[27];
  103.   long      = string[150];
  104.   sysid     = record
  105.                 user: person;
  106.                 exfl: byte;
  107.                 lsto: name;
  108.                 lstm: integer;
  109.                 pass: name;
  110.                 acc:  byte;
  111.                 clr:  name;
  112.                 bsp:  char;
  113.                 lnf:  char;
  114.                 upc:  boolean;
  115.                 wid:  byte;
  116.               end;
  117.   log       = record
  118.                 who:  integer;
  119.                 when: name;
  120.                 done: name;
  121.               end;
  122.   yesno     = array[boolean] of string[3];
  123.  
  124. const yn: yesno = ('NO','YES');
  125.  
  126. var
  127.   libfile:    file;
  128.   libbuff:    filbuffer;
  129.   libeof:     boolean;
  130.   logfile:    file of log;
  131.   logrec:     log;
  132.   idfile:     file of sysid;
  133.   idrec:      sysid;
  134.   caller:     person;
  135.   password,
  136.   timeon,
  137.   timeoff,
  138.   cs,
  139.   message:    name;
  140.   baud:       rate;
  141.   buffer:     long;
  142.   access:     byte;
  143.   libsects,
  144.   usernum,
  145.   lastmess,
  146.   nextmess,
  147.   charcount,
  148.   lastspace,
  149.   bufpointer,
  150.   width:      integer;
  151.   controls,
  152.   printon,
  153.   local,
  154.   filesopen,
  155.   messopen,
  156.   caps,
  157.   expert:     boolean;
  158.   exitchar, bl, lf, bs     : char;
  159.   sec,   onsec,   offsec   : byte;
  160.   min,   onmin,   offmin   : byte;
  161.   hour,  onhour,  offhour  : byte;
  162.   date,  ondate,  offdate  : byte;
  163.   month, onmonth, offmonth : byte;
  164.   usesec, usemin, usehour  : integer;
  165.  
  166. {$I MACHDEP.IBM}
  167. {$I IO.INC}
  168. {$I MAILSYS.INC}
  169. {$I FILESYS.INC}
  170. {$I BBS2.INC}
  171.  
  172. begin
  173.   lowvideo;
  174.   exitchar := space;
  175.   local := false;
  176.   resetbuff;
  177.   setup;
  178.   defaults;
  179.   awaitcall;
  180.   repeat
  181.     if clockin then begin
  182.       clock(onmonth, ondate, onhour, onmin, onsec);
  183.       timeon := time(onmonth, ondate, onhour, onmin, onsec);
  184.     end;
  185.     flush;
  186.     resetbuff;
  187.     lineout('TurboBBS version ' + version);
  188.     if cts and not cancelled then outfile(welcome);
  189.     if cts and not cancelled then outfile(bulletin);
  190.     if cts then signon(caller);
  191.     if cts then initmess;
  192.     readmine; {checks for cts internally}
  193.     if cts then command;
  194.     writeln('hung up...');
  195.     endcall;
  196.     if messopen then closemess;
  197.     close(idfile);
  198.     unload;
  199.     defaults;
  200.     awaitcall;
  201.   until exitchar = abort;
  202. end.
  203.